package com.google.code.yargon.engine;

import java.util.LinkedList;

import org.apache.log4j.Logger;

import com.google.code.yargon.level.*;
import com.google.code.yargon.util.LogUtil;

public class AI {
	
	private LinkedList<Creature> creatureList;
	
	private static AI instance = null;
	
	@SuppressWarnings("unused")
	private Logger log = LogUtil.getInstance();
	
	public static AI getInstance() {
		if(null == instance) {
			instance = new AI();
		}
		return instance;
	}
	
	private AI() {
		creatureList = new LinkedList<Creature>();
	}
	
	public void add(Location l) {
		Creature rat = new Creature();
		rat.setLocation(l);
		creatureList.add(rat);
	}
	
	public void update() {
			
		for(Creature c: creatureList) {
			c.move(LevelManager.getInstance().get(c.getLocation().getZ()));
		}
	}
	
	public LinkedList<Creature> getCreatures() {
		return creatureList;
	}
}
